import request from "@/utils/request";
export function loginByUsername(data) {
  return request({
    url: "/waste/sysUser/login",
    method: "post",
    data
  });
}
//根据sessionid获取用户信息
export function loginGetUserInfo(code) {
  
  return request({
    url: `/waste/sysUser/getSelfInfo`,
    method: "get",
    headers:{
      "Authorization":code
    }
  });
}
export function loginToken(data) {
  return request({
    method: "post",
    url: "cms/loginByTokenid",
    data
  });
}
//发送短信验证码
export function sendMessage(params) {
  return request({
    method: "get",
    url: "/waste/sysUser/sendMessage",
    params
  });
}

//发送短信验证码
export function loginWithSmsCode(params) {
  return request({
    method: "get",
    url: "/waste/sysUser/loginWithSmsCode",
    params
  });
}

//医院注册
export function hospitalBaseRegister(data) {
  return request({
    method: "post",
    url: "/waste/hospitalBase/register",
    data
  });
}

//获取图片验证码
export function randomValidateCode(data) {
  return request({
    method: "get",
    url: "/waste/sysUser/randomValidateCode",
    responseType: "arraybuffer"
    // responseType: "blob"
  });
}
//忘记密码
export function modifyPasswordWithRandomValidateCode(data) {
  return request({
    method: "post",
    url: "/waste/sysUser/modifyPasswordWithRandomValidateCode",
    data
  });
}
